<?php
namespace Core\Forms\Element;

use Phalcon\Tag;
use Core\Forms\Element;
use Phalcon\Forms\Exception;

class Radio extends Element
{
    public function render($attributes = null)
    {
        if (is_array($attributes) === false &&
            is_null($attributes) === false
        ) {
            throw new Exception('Invalid parameter type.');
        }

        return Tag::radioField($this->prepareAttributes($attributes, true));
    }
}
